<template>
  <section id="businessGroupErcodePage">
    <div class="flex">
      <span class="item solid"></span>
      <span class="item2">支付宝的商户组列表</span>
    </div>
    <el-table :data="tableData" border stripe style="width: 100%" v-loading="loading">
      <el-table-column type="index" width="80">
      </el-table-column>
      <el-table-column prop="name" label="商户组名" width="140">
      </el-table-column>
      <el-table-column label="操作">
        <template  slot-scope='scope'>
          <div style="white-space: nowrap">
            <el-button type="text" size="small" @click="goErcode(scope.row.id)">商户管理</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
    <el-dialog title="提示"  :visible.sync="dialogVisible" size="tiny">
      <img :src="erSrc" alt="" >
      <div v-text="title"></div>
      <span slot="footer" class="dialog-footer">
    <el-button @click="dialogVisible = false">取 消</el-button>
    <el-button type="primary" @click="dialogVisible = false">确 定</el-button>
  </span>
    </el-dialog>

    <!--<div class="block" style="text-align: right;padding: 10px 20px;">-->
    <!--<el-pagination @current-change="handleCurrentChange" :current-page.sync="pageNumber"-->
    <!--:page-size="pageSize" layout="total, prev, pager, next" :total="total">-->
    <!--</el-pagination>-->
    <!--</div>-->
  </section>
</template>

<script>
  import dateformat from 'dateformat'

  export default {
    data () {
      return {
        tableData: [{}],
        total: 1,
        loading: false,
        dialogVisible: false,
        erSrc: undefined,
        pageSize: 10,
        pageNumber: 1,
        id: '',
        title: '',
        loading2: false
      }
    },
    created() {
     this.getBusinessGroup()
    },
    methods: {
      getBusinessGroup() {
      this.loading = true;
        this.$api.getBusinessGroupList(10).then(res => {
          if (res.code == '000000'){
//            this.$message.success('h')
            this.loading = false;
            this.tableData = res.data;
          }
        })
      },
      goErcode(id){
        this.$router.push({
          path:'/user/ercode2',
          query: {
            id: id
          }
        })
      },
      handleCurrentChange(val) {
        this.pageNumber = val
        this.getBusinessGroup()
      }
    }
  }
</script>

<style lang="less">
  #businessGroupErcodePage {
    th {
      text-align: center;
    }
    .flex {
      align-items: center;
      padding-bottom: 10px;
      /*border-bottom: 1px solid #ccc;*/
      .solid{
        width: 2px;
        height: 30px;
        background-color: green;
      }
      .item2{
        padding-left: 20px;
        font-weight: bold;
      }
    }

    .el-input__inner {
      height: 25px;
      font-size: 12px;
    }
    .el-input {
      width: 160px;
      display: inline-block;
      margin: 0 8px;
      margin: 0;
    }

    .title1 {
      font-size: 14px;
    }
  }
</style>
